FLAG			BIT 00H
			ORG 00H
START:			JB P1.7,START
			JNB FLAG,NEXT
			MOV R2,#200
DV:			CPL P1.0
			LCALL DELY500
			LCALL DELY500
			DJNZ R2,DV
			CPL FLAG
NEXT:			MOV R2,#200
DV1:			CPL P1.0
			LCALL DELY500
			DJNZ R2,DV1
			CPL FLAG
			SJMP START
DELY500:		MOV R7,#250
LOOP:			NOP
			DJNZ R7,LOOP
			RET
			END
